<?php


namespace app\common\validate;


class FileValidate extends BaseValidate
{
    protected $rule = [
        'image'=>['fileExt' => 'bmp,png,jpg,jpeg,tif,gif,psd,ai,raw,webp', 'fileSize' =>10485760],
        'video'=>['fileExt' => 'wmv,asf,asx,rm,rmvb,mp4,3gp,mov,m4v,aiv,mkv,flv,vob,avi', 'fileSize' =>10485760],
        'audio'=>['fileExt' => 'wav,flac,ape,alac,wv,mp3,acc,ogg', 'fileSize' =>10485760],
        'file'=>['fileExt' => 'pdf,doc,docx,xlsx,xls,csv', 'fileSize' =>10485760],
        'hybrid'=>['fileExt' => 'zip,rar,7z', 'fileSize' =>10485760]
    ];

    protected $message = [
        'image.fileExt' => '图片的格式支持:bmp,png,jpg,jpeg,tif,gif,psd,ai,raw,webp',
        'image.fileSize' => '图片大小不能大于10Mb',
        'file.fileExt' => '文件的格式支持:pdf,txt,epub,chm,mobi,pobi,kfx,azw,azw3,doc,docx,xlsx,xls,csv,ppt,pptx',
        'file.fileSize' => '文件大小不能大于10Mb',
        'hybrid.fileExt'=> '文件的格式支持:zip,rar,7z',
        'hybrid.fileSize' => '文件大小不能大于10Mb',
    ];
}